<?php global $ubi?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Ubiquitous</title>
    <link href="include/css/style.css" rel="stylesheet" type="text/css" />
    <link href="include/css/form.css" rel="stylesheet" type="text/css" />    
    <link rel="stylesheet" href="include/css/jquery-ui.css" type="text/css" />
        
	<script language="javascript" src="include/script/jquery-1.4.4.min.js" type="text/javascript"></script>
	<script language="javascript" src="include/script/jquery.corner.js" type="text/javascript"></script>    
	<script type="text/javascript" src="include/script/jquery-ui-1.8.14.custom.min.js"></script>
	<script type="text/javascript" src="include/script/script.js"></script>    
    <!--[if lte IE 6]>
        <script type="text/javascript" src="include/css/supersleight-min.js"></script>
        <link href="css/ie6.css" rel="stylesheet" type="text/css" />
    <![endif]-->

	<script language="javascript" type="text/javascript">
		$(document).ready(function(){
			$('.organicContent2').corner("5px");
			$('.organicContent2 h2').corner("5px");
			$('.organicContent4').corner("5px");
			$('.organicContent4 h2').corner("5px");
			
			$("#datepicker").datepicker(
				{dateFormat:'dd/mm/yy', 
				 changeMonth: true,
				 changeYear: true,
				 yearRange: '1930:2010'});

			$('input[name="txtUserName"]').val('');
			$('input[name="txtPassword"]').val('');
			$('input[name="txtRePassword"]').val('');
			});
    </script>
</head>

<body>
<div id="main"><!-- Main starts here -->

<?php
	require_once $ubi['SERVER']['SERVER_ROOT'] . '/template/header.php';	 
?>
<div class="clear"></div>
<div class="contentTop"></div>
<div class="content">	
    <div class="organic">
		<div style="margin-left:60px; margin-top:10px; line-height:1.2em">
        	<h1>Cập nhật thông tin người dùng</h1>
        	<?php
        		if (isset($notice))
        		{
        	?> 
        	<span id="err" class="red">
        		<?php echo $notice;?>
			</span>
			<?php
        		}
			?>
        	<span id="err" class="red">
        		<?php        			
        			if (isset($errList)) {
						for ( $i = 0; $i <= sizeof($errList); $i++) {
							echo $errList[$i] . '<br />';
						}
        			}
        		?>
        	</span>
            <form action="index.php?update&type=user" method="post" name="registration_form" enctype="multipart/form-data">
	            <fieldset class="reg">
	            	<legend>Thông tin tài khoản</legend>
	                <ol>
	                    <li class="input">
	                    	<label>Email</label>
	                        <input type="text" name="txtEmail" /><br />
	                        <label>&nbsp;</label>
	                        <span class="note">Thông tin đăng ký thành viên sẽ được gửi qua email này</span>
	                    </li>
	                </ol>
	            </fieldset>
				<fieldset class="reg">
	            	<legend>Thông tin người dùng</legend>
	                <ol>
	                	<li class="input">
	                    	<label>Họ</label>
	                    	<input type="text" name="txtLastName" />
	                    </li>
	                    <li class="input">	
	                    	<label>Tên</label>
	                        <input type="text" name="txtFirstName" />
	                    </li>
	                	<li class="input">
	                    	<label>Giới Tính</label>
							<select name="selGender">
	                        	<option value="0" <?php echo $user->getGender()==0?'selected="selected"':''?>>Nam</option>
	                            <option value="1" <?php echo $user->getGender()==1?'selected="selected"':''?>>Nữ</option>
	                        </select>
	                    </li>   
	                    <li class="input">
	                    	<label>Ngày Sinh</label>
							<input id="datepicker" type="text" name="txtDOB" />
	                    </li>                    
	                    
	                    <li class="input">
	                    	<label>Nghề Nghiệp</label>	                    	
	                        <select name="selOccupation">
	                        	<?php
	                        		for ($i = 0; $i < sizeof($occupationList); $i++) {
	                        			$occupationModel = $occupationList[$i];
	                        			$id = $occupationModel->getOccupationID();
	                        			$name = $occupationModel->getOccupationName();
	                        			if ($user->getOccupationID() == $id)    			
	                        				echo "<option value='$id' selected=\"selected\">$name</option>\n";
	                        			else 
	                        				echo "<option value='$id'>$name</option>\n";
	                        		}
	                        	?>
	                        </select>
	                    </li>
	                </ol>
	            </fieldset>
	            <fieldset class="reg">
	            	<legend>Thông tin liên hệ</legend>
	                <ol>
	                	
	                    <?php
		                    require_once $ubi['SERVER']['SERVER_ROOT'] . '/view/viewPhoneInput.php';
		                    require_once $ubi['SERVER']['SERVER_ROOT'] . '/view/viewAddressInput.php';
	                    ?>
	                </ol>
	            </fieldset>
	            <input type="submit" value="Lưu thay đổi" />
            </form>            
        </div>
    </div>    
</div>
<div class="contentBottom"></div>

<?php
	require_once $ubi['SERVER']['SERVER_ROOT'] . '/template/footer.php'; 
?>

</div><!-- Main ends here -->
</body>
</html>
